/*******************************************************************************
 * Copyright (c) 2012 Alexandr Tsvetkov.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Alexandr Tsvetkov - initial API and implementation
 * 
 * Project:
 *     TAO Library
 * 
 * File name:
 *     RegExp.java
 *     
 * License agreement:
 *
 * 1. This code is published AS IS. Author is not responsible for any damage that can be
 *    caused by any application that uses this code.
 * 2. Author does not give a garantee, that this code is error free.
 * 3. This code can be used in NON-COMMERCIAL applications AS IS without any special
 *    permission from author.
 * 4. This code can be modified without any special permission from author IF AND ONLY IF
 *    this license agreement will remain unchanged.
 * 5. SPECIAL PERMISSION for this code usage in COMMERCIAL application SHOULD be obtained
 *    from author.
 ******************************************************************************/
package ua.at.tsvetkov.strings;

/**
 * Different RegExp string constants.
 * 
 * @author A.Tsvetkov 2011. http://tsvetkov.at.ua email: al@ukr.net
 */
public class RegExp {

	/**
	 * Russia phone number
	 */
	public static final String	phoneNumberRu	= "^((8|\\+7)[\\- ]?)?(\\(?\\d{3}\\)?[\\- ]?)?[\\d\\- ]{7,10}$";
	/**
	 * Ukraine phone number
	 */
	public static final String	phoneNumberUa	= "^((8|\\+3)[\\- ]?)?(\\(?\\d{3}\\)?[\\- ]?)?[\\d\\- ]{7,10}$";
	/**
	 * IP adress
	 */
	public static final String	ipAdress			= "/^\\d+\\.\\d+\\.\\d+\\.\\d+$/";
	/**
	 * IP adress
	 */
	public static final String	ipAdress2			= "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b";
	/**
	 * Strong check e-mail
	 */
	public static final String	email				= "([\\w-+]+(?:\\.[\\w-+]+)*@(?:[\\w-]+\\.)+[a-zA-Z]{2,7})";
	/**
	 * E-mail
	 */
	public static final String	e_mail			= ".+@.+\\.[a-z]+";
	/**
	 * Url
	 */
	public static final String	url				= "^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$";
	/**
	 * User name from 3 to 16 chars
	 */
	public static final String	username			= "^[a-z0-9_-]{3,16}$";
	/**
	 * Password from 6 to 18 chars
	 */
	public static final String	password			= "^[a-z0-9_-]{6,18}$";
	/**
	 * Hex color
	 */
	public static final String	hexColor			= "^#?([a-f0-9]{6}|[a-f0-9]{3})$";
	/**
	 * XML tag
	 */
	public static final String	xml				= "^<([a-z]+)([^>]+)*(?:>(.*)<\\/\\1>|\\s+\\/>)$";

}
